// https://wanandroid.com

import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import AutoImport from 'unplugin-auto-import/vite'
import Components from 'unplugin-vue-components/vite'
import { ElementPlusResolver } from 'unplugin-vue-components/resolvers'

 
export default defineConfig({
  plugins: [vue(),
    AutoImport({
      resolvers: [ElementPlusResolver(),],
      imports: ['vue',"vue-router"]
    }),
    Components({
      resolvers: [ElementPlusResolver()],
    })
 ],
  server:{
    host:"192.168.202.66",
    open:false, //自动打开
    proxy: {
      '/api': {
        target: 'https://wanandroid.com', //跨域地址
        changeOrigin: true, //是否允许跨域
        rewrite: (path) => path.replace(/^\/api/, ""), //重写路径
      }
    },
  }
})